
import Vue from 'vue'
import VueRouter from 'vue-router'
import { generatorRoutes } from '@/utils/utils'
// import store from '@/store/index'

Vue.use(VueRouter)
const routess = generatorRoutes()
console.log('路由请求', routess)
const routes = [
  // {
  //   path: '/',
  //   redirect: '/Index'
  // },
  //  { name: "/", path: "/", component: Layout, redirect: "/index", hidden: false, children: [
  //       { name: "index", path: "/index", meta: { title: "index" }, component: () => import("../views/index/index") },
  //   ]},
  {
    name: 'home',
    path: '/',
    meta: {
      title: '首页',
    },
    component: () => import('@/views/home.vue')
  },
  {
    path: '/detail',
    component: () => import('@/views/detail.vue')
  },
  ...routess,
  {
    name: 'login',
    meta: {
      title: '登录'
    },
    path: '/login',
    component: () => import('@/views/login.vue')
  },
  {
    path: '/facetoface',
    component: () => import('@/views/facetoface.vue')
  }, {
    path: '/facetoface',
    component: () => import('@/views/facetoface.vue')
  },
  {
    name: '404',
    path: "*",
    meta: {
      title: '404'
    },
    component: () => import('@/views/404.vue')
  },
]

const router = new VueRouter({
  mode: 'hash',
  routes
})


export default router
